package com.windowes.weichang.controller.common;

import com.windowes.weichang.common.ServerResponse;
import com.windowes.weichang.service.SmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/***
 *
 * @author: yangqing
 * @email: qing.yang@bangdao-tech.com
 * @createTime: 2018/5/23 下午8:38
 * @description:
 *
 **/
@RestController
@RequestMapping("/sms")
@Api(description = "短信、验证码相关API")
public class SmsController {

    @Autowired
    SmsService smsService;

    @ApiOperation(value = "获取注册验证码", notes = "")
    @GetMapping("getRegisterValidCode")
    public ServerResponse getRegisterValidCode(String phone) {
        return smsService.getRegisterValidCode(phone);
    }


    @ApiOperation(value = "获取登陆验证码", notes = "")
    @GetMapping("getLoginValidCode")
    public ServerResponse getLoginValidCode(String phone) {
        return smsService.getLoginValidCode(phone);
    }

    @ApiOperation(value = "获取重置密码验证码", notes = "")
    @GetMapping("getResetValidCode")
    public ServerResponse getResetValidCode(String phone) {
        return smsService.getResetValidCode(phone);
    }

}
